Implementing synchronization for remote disk mirroring

ABSTRACT

A method, and system for implementing enhanced fast full synchronization for remote disk minoring in a computer system. A source backup copy is made locally available to a target for remote disk mirroring. Sectors are identified that are different between the source and target. A hash function is used over a block to be compared, with an adaptive number of tracking sectors per block, starting with a minimum block size.

This application is a continuation application of Ser. No. 14/969,785filed Dec. 15, 2015.

FIELD OF THE INVENTION

The present invention relates generally to the data processing field,and more particularly, relates to a method, system and memory controllerfor implementing enhanced fast full synchronization for remote diskmirroring.

DESCRIPTION OF THE RELATED ART

Remote disk minoring copies disk sectors from source disks to targetdisks by sending the sectors through a network to the target. A changeto a disk sector on a source disk is mirrored or copied to the targetdisk. An example is SAN (Storage Area Network) mirroring, such as IBMSVC (SAN Volume Controller) Metro and Global Mirror.

The primary purpose of remote disk minoring is to have a remote backupcopy of the source in case the source fails. A tracking space is used tokeep track of changes on the source that haven't been copied to thetarget. Typically a tracking space is a bit map of tracking sectors,which are a fixed number of adjacent disk sectors. If the bit is on,then the corresponding disk sectors for that tracking sector are to becopied. In this way, a source can accumulate changes to send to thetarget, and as long as the source does not lose its tracking, a targetcan be synchronized.

A full synchronization occurs when the target gets a complete copy ofthe source. A full synchronization is required when the tracking spacebetween the source and the target is lost or no longer valid. This mayhappen, for example, in the event of the failure of the source ortarget, a new target for the source, or a new source for the target.

A full synchronization is to be avoided as much as possible due to theamount of time and network bandwidth a full synchronization may take.Depending on the amount of data and network speed, a fullsynchronization could take days. The greater the distance between sourceand target, typically the greater the time for a full synchronizationdue to the round trip latency of acknowledgments and messages.

It is not possible to eliminate all full synchronizations. For example,a new target needs to have a full copy of the source, and hardwarefailures do occur with a corresponding loss of data.

A need exists for an effective mechanism to reduce the time required forfull synchronization for remote disk mirroring.

SUMMARY OF THE INVENTION

Principal aspects of the present invention are to provide a method,system and memory controller for implementing enhanced fast fullsynchronization for remote disk mirroring in a computer system. Otherimportant aspects of the present invention are to provide such method,system, and memory controller substantially without negative effects andthat overcome many of the disadvantages of prior art arrangements.

A source backup copy is made locally available to a target for remotedisk mirroring. The backup copy can be applied to the target. Sectorsthat are different between the source and the target are identified. Ahash function is used over a block to be compared, with the block beingmade up of an adaptive number of tracking sectors. Blocks will startwith a minimum block size, such as 1 tracking sector.

In accordance with features of the invention a selected hash function isused, such as cryptographic hash algorithms SHA-1 (Secure HashAlgorithm 1) or SHA-2 (Secure Hash Algorithm 2).

In accordance with features of the invention, when the hashes matchbetween source and target, the next block size is increased by anintegral number of tracking sectors. When the hashes do not match, thenthe block size is reduced by an integral number of tracking sectorsuntil the minimum block size is reached or the hashes match.

In accordance with features of the invention, a tracking space bit mapfor remote disk mirroring is used for full synchronization. Initially,all the tracking space bits on the source are turned off indicating alltracking sectors are synchronized. While the full synchronization iscomparing hashes no tracking sectors are sent. A tracking space bit isset to 1 if a corresponding tracking sector is changed on the sourceduring the full synchronization. This allows concurrent source changeswhile the full synchronization is being performed.

In accordance with features of the invention, if a hash does not matchand the block is the minimum block size then the tracking space bits forall tracking sectors in the block are set to 1. After all hashes havebeen compared, the tracking space will have a 1 for each tracking sectorthat needs to be sent to the target. The tracking space accuratelyreflects the changed tracking sectors between the source and the target,and the remote disk mirroring can begin sending the changed trackingsectors using standard remote disk mirroring algorithms.

BRIEF DESCRIPTION OF THE DRAWINGS

The present invention together with the above and other objects andadvantages may best be understood from the following detaileddescription of the preferred embodiments of the invention illustrated inthe drawings, wherein:

FIGS. 1A and 1B provide a block diagram of an example computer systemembodying the present invention;

FIGS. 2A and 2B together provide a flow diagram illustrating examplesteps for implementing enhanced fast full synchronization for remotedisk minoring in the computer system of FIG. 1 in accordance withpreferred embodiments;

FIG. 3 illustrates the example steps of FIG. 2 in accordance with thepreferred embodiments for an example tracking space bit map, where theblock size is doubled when hashes match, the block size is reduced tothe minimum block size when hashes do not match, and the minimum blocksize is 1 tracking sector; and

FIG. 4 is a block diagram illustrating a computer program product inaccordance with the preferred embodiment.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

In the following detailed description of embodiments of the invention,reference is made to the accompanying drawings which illustrate exampleembodiments by which the invention may be practiced. It is to beunderstood that other embodiments may be utilized and structural changesmay be made without departing from the scope of the invention.

The terminology used herein is for the purpose of describing particularembodiments only and is not intended to be limiting of the invention. Asused herein, the singular forms “a”, “an” and “the” are intended toinclude the plural forms as well, unless the context clearly indicatesotherwise. It will be further understood that the terms “comprises”and/or “comprising,” when used in this specification, specify thepresence of stated features, integers, steps, operations, elements,and/or components, but do not preclude the presence or addition of oneor more other features, integers, steps, operations, elements,components, and/or groups thereof.

In accordance with features of the invention, a method, system andmemory controller are provided for implementing enhanced fast fullsynchronization for remote disk mirroring in a computer system.

In accordance with features of the invention, a static table of hashesis not used and so there is no overhead associated with maintaining suchtables. Hashes are computed when needed. An adaptive number of trackingsectors is included in a block. Spatial locality is used to increase ordecrease block size based on whether hashes match between the source andtarget. A remote disk mirroring tracking space bit map is used.

Having reference now to the drawings, in FIGS. 1A and 1B, there is showna computer system embodying the present invention generally designatedby the reference character 100 for implementing enhanced fast fullsynchronization for remote disk minoring in accordance with thepreferred embodiment. Computer system 100 includes one or moreprocessors 102 or general-purpose programmable central processing units(CPUs) 102, #1-N. As shown, computer system 100 includes multipleprocessors 102 typical of a relatively large system; however, system 100can include a single CPU 102. Computer system 100 includes a cachememory 104 connected to each processor 102.

Computer system 100 includes a memory system 106 including a memorycontroller 108 and a main memory 110 connected by a bus 112. Bus 112 isone or more busses that send address/command information to main memory110 and send and receive data from the memory 110. Main memory 110 is arandom-access semiconductor memory for storing data, including programs.Main memory 110 is comprised of, for example, a dynamic random accessmemory (DRAM), a synchronous direct random access memory (SDRAM), acurrent double data rate (DDRx) SDRAM, non-volatile memory, opticalstorage, and other storage devices.

I/O bus interface 114, and buses 116, 118 provide communication pathsamong the various system components. Bus 116 is a processor/memory bus,often referred to as front-side bus, providing a data communication pathfor transferring data among CPUs 102 and caches 104, memory controller108 and I/O bus interface unit 114. I/O bus interface 114 is furthercoupled to system I/O bus 118 for transferring data to and from variousI/O units.

As shown, computer system 100 includes a storage interface 120 coupledto storage devices, such as a direct access storage device (DASD) 122and a CD-ROM 124. Computer system 100 includes a terminal interface 126coupled to a plurality of terminals 128, #1-M, a network interface 130coupled to a network 132, such as the Internet, local area, or othernetworks, and an I/O device interface 134 coupled to I/O devices, suchas a first printer/fax 136A and a second printer 136B.

I/O bus interface 114 communicates with I/O interface units 120, 126,130, and 134, which are also known as I/O processors (IOPs) or I/Oadapters (IOAs), through system I/O bus 118. System I/O bus 118 is, forexample, an industry standard PCI bus, or other appropriate bustechnology.

Referring to FIG. 1B, computer system 100 includes a source storage 150on a source 151 and a target storage 152 on a target 153 coupled torespective controllers 154 and 156, a source local backup copy 160locally available to the target for remote disk mirroring, a hashcompare between source and target 162 on the source, a hash comparebetween source and target 164 on the target, and a tracking space (TS)bit map 166 for remote disk mirroring used for full synchronization.

Computer system 100 is shown in simplified form sufficient forunderstanding the present invention. The illustrated computer system 100is not intended to imply architectural or functional limitations. Thepresent invention can be used with various hardware implementations andsystems and various other internal hardware devices.

In accordance with features of the invention, when the hashes matchbetween source and target, the next block size is increased by anintegral number of tracking sectors. When the hashes do not match, thenthe block size decreased by an integral number of tracking sectors, to aminimum of the minimum tracking block size.

In accordance with features of the invention, if a hash does not matchand the block is the minimum block size then the tracking space bits forall tracking sectors in the block are set to 1. After all hashes havebeen compared, the tracking space will have a 1 for each tracking sectorthat needs to be sent to the target. The tracking space accuratelyreflects the changed tracking sectors between the source and the target,and the remote disk mirroring can begin sending the changed trackingsectors using standard remote disk mirroring algorithms.

In accordance with features of the invention, a tracking space bit mapfor remote disk mirroring is used for the full synchronization.Initially, all the tracking space bits on the source are turned offindicating all tracking sectors are synchronized. While the full sync iscomparing hashes, no tracking sectors are sent, but a tracking space bitis set to 1 if a corresponding tracking sector is changed on the sourceduring the full synchronization. This allows concurrent source changeswhile the full synchronization is being performed.

Referring now to FIGS. 2A and 2B there are shown example steps generallydesignated by the reference character 200 for implementing enhanced fastfull synchronization for remote disk mirroring in the computer system100 in accordance with the preferred embodiment. In FIGS. 2A and 2B, TSPrepresents a tracking sector pointer, BKS represents block size, BKMrepresents minimum block size, BKX represents the maximum block size,REM represents the remaining tracking sectors on the target node, BKIrepresents the amount the block size is incremented by, and BKDrepresents the amount the block size is decremented by. As indicated ata block 201, the target is initialized and a backup or previous versionis loaded on the target with BKS set to 1 tracking sector and TSP set totracking sector 1. As indicated at a block 202, on the source thetracking space is created with all bits set to 0 and the TSP is set totracking sector 1. On the target, as indicated at a block 203 the blockhash is computed based on the tracking sector pointer and the blocksize, and the computed hash, tracking sector pointer and block size aresent to the source. As indicated at a block 204, the source waits for amessage from the target. On the source, the corresponding block hash iscomputed, the generated hash is compared to the hash received from thetarget, and a Match or No_Match message is sent to the target asindicated at a block 205. A selected hash function is used, such ascryptographic hash algorithms SHA-1 (Secure Hash Algorithm 1) or SHA-2(Secure Hash Algorithm 2) at blocks 203 and 205. On the target, asindicated at a block 206 the target waits for a message from the source.Then operations continue as shown in FIG. 2B.

In FIG. 2B on the source, when the hashes match as indicated at adecision block 208 the source increments the tracking sector pointer bythe number of tracking sectors in the block or TSP=TSP+BKS as indicatedat a block 210. Checking for more sectors is performed as indicated at adecision block 212, the source returns to block 204 in FIG. 2A if thereare more sectors. If the target has no more sectors, any remainingtracking space (TS) bits on the source are set to 1 as indicated at ablock 214, and operations end as indicated at a block 216.

On the target, when the hashes match as indicated at a decision block218, the target checks if there are more tracking sectors as indicatedat a decision block 220, and if there are no more tracking sectorsoperations end as indicated at a block 222. If there are more trackingsectors at decision block 220, then the target increments the trackingsector pointer by the block size and the block size is increased by theblock size increment as indicated at a block 224. Then the block size iscompared to the minimum of the remaining number of tracking sectors andthe maximum block size at a decision block 225. If the block size isgreater than the minimum of the remaining number of tracking sectors andthe maximum block size at decision block 225 then the block size is setto the minimum of the remaining number of tracking sectors and themaximum block size at a block 227. Then the target operations return toblock 203 in FIG. 2A. If the block size is less than or equal to theminimum of the remaining number of tracking sectors and the maximumblock size at decision block 225 then the target operations return toblock 203 in FIG. 2A.

On the target, when no match is found at decision block 218, the blocksize is compared to the minimum block size as indicated at a decisionblock 226. If the block size is the minimum block size the targetincrements the tracking sector pointer by the minimum block size asindicated at a block 228. Then the target operations return to block 203in FIG. 2A. If the block size is not the minimum block size, the targetreduces the block size by the block size decrement value as indicated ata block 230. The block size is compared to the minimum block size at adecision block 231. If the block size is greater than or equal to theminimum block size then the target operations return to block 203 inFIG. 2A. If the block size is less than the minimum block size at ablock 231 the block size is set to the minimum block size at a block233. Then the target operations return to block 203 in FIG. 2A.

On the source, when no match is found at decision block 208, the blocksize is compared to the minimum block size at a decision block 232. Asindicated at a block 234 if the block size is equal to the minimum blocksize the source sets the corresponding tracking space bits to 1,indicating the tracking sectors are to be sent. Then the sourceoperations return to block 210. If the block size is not the minimumblock size the source returns operations to block 204 in FIG. 2A.

Referring now to FIG. 3, there is shown example tracking space bit mapdesignated by the reference character 300 illustrating the example stepsfor implementing enhanced fast full synchronization for remote diskmirroring in accordance with the preferred embodiments. This exampleassumes a minimum block size of 1 tracking sector, a block incrementvalue equal to the current block size, and a block decrement value equalto one less than the current block size. In the tracking space bit map300, S0 through SN are the tracking sectors represented by the trackingspace bit map. Sectors S10 and S11 are changed. The tracking space hasn+1 bits, T0 through TN, which correspond to each of the sectors. Eachrow is a block that is sent.

The full synchronization starts at row 1 in FIG. 3, with block B1 at theminimum size of 1 tracking sector (sector SO). The B1 hash will match onsource and target, so the next block B2 is doubled to 2 tracking sectors(sectors S1-S2). B2 also matches, so the block size for B3 is doubled to4 tracking sectors (sectors S3-S6). The block size continues to doubleif the hashes match, to a maximum size which is dependent on the hashused and the total number of tracking sectors.

Block B4 has 8 tracking sectors (sectors S7-S14), but has a hashmismatch. Block B5 starts with the minimum block size of 1 trackingsector (sector S7), which matches. Block B6 is now doubled to 2 trackingsectors (sectors S8-S9), which also match. Block B7 is doubled to 4sectors (sectors S10-S13), but has a hash mismatch.

Block B8 then starts again with 1 tracking sector (sector S10). The hashfor B8 doesn't match, and since it is only 1 tracking sector the blockis considered processed and the tracking space bit for S10 is set. BlockB9 block size remains at 1 tracking sector (sector S11). The hash for B9does not match, so the tracking space bit for S11 is set, and block B10will have the next tracking sector (sector S12). The B10 hash matches,so block B11 will contain the next 2 sectors (sectors S13-S14).

Using this example shown in FIG. 3, only 2 tracking sectors are sentfrom source to target, rather than 15 tracking sectors. Regardinghashes, 11 are sent using adaptive blocks compared to 15 hashes if ahash is sent for each tracking sector. The hash saving may not seemsignificant, but depending on the distribution of the changed trackingsectors the number of hashes sent with the method of the invention canbe much less. For example, if there had been no changed trackingsectors, then the method of the invention would use 4 hashes compared to15 hashes if one hash is sent per tracking sector.

Referring now to FIG. 4, an article of manufacture or a computer programproduct 400 of the invention is illustrated. The computer programproduct 400 is tangibly embodied on a non-transitory computer readablestorage medium that includes a recording medium 402, such as, a floppydisk, a high capacity read only memory in the form of an optically readcompact disk or CD-ROM, a tape, or another similar computer programproduct. Recording medium 402 stores program means 404, 406, 408, and410 on the medium 402 for carrying out the methods for implementingenhanced fast full synchronization for remote disk mirroring of thepreferred embodiment in the system 100 of FIG. 1.

A sequence of program instructions or a logical assembly of one or moreinterrelated modules defined by the recorded program means 404, 406,408, and 410, direct the memory controller 108, computer system 100, andmemory subsystem 200 for implementing enhanced fast full synchronizationfor remote disk mirroring of the preferred embodiment.

While the present invention has been described with reference to thedetails of the embodiments of the invention shown in the drawing, thesedetails are not intended to limit the scope of the invention as claimedin the appended claims.

1-19. (canceled)
 20. A system for implementing enhanced fast fullsynchronization for remote disk mirroring in a computer systemcomprising: a source storage and a target storage; a tracking space bitmap for remote disk mirroring used for full synchronization; arespective memory controller coupled to said source storage and saidtarget storage, said respective memory controller providing a sourcebackup copy locally available to the target for remote disk mirroring;said respective memory controller identifying sectors that are differentbetween the source and target during the full synchronization using ahash function over a block to be compared with no tracking sectors beingsent, setting a tracking space bit in said tracking space bit map foreach tracking sector to be sent to the target and setting a trackingspace bit responsive to a corresponding tracking sector being changed onthe source during the full synchronization.
 21. The system as recited inclaim 20 includes control code stored on a computer readable medium, andwherein said respective memory controller uses said control code forimplementing full synchronization for remote disk mirroring.
 22. Thesystem as recited in claim 20 includes said respective memory controlleron the source using said tracking space bit map for remote diskmirroring for the full synchronization.
 23. The system as recited inclaim 20 includes said respective memory controller turning off all thetracking space bits on the source indicating all tracking sectors aresynchronized.
 24. The system as recited in claim 20 includes saidrespective memory controller responsive to all hashes having beencompared, sending the changed tracking sectors using said tracking spacebit map.
 25. The system as recited in claim 24 includes said memorycontroller on the source initially turning off all the tracking spacebits on the source indicating all tracking sectors are synchronized. 26.The system as recited in claim 25 wherein said respective memorycontroller setting a tracking space bit in said tracking space bit mapincludes said memory controller setting said tracking space bit to 1.27. The system as recited in claim 20 wherein said respective memorycontroller identifying sectors that are different between the source andtarget during the full synchronization using a hash function over ablock to be compared with no tracking sectors being sent includes saidmemory controller using the block being made up of an adaptive number oftracking sectors.
 28. The system as recited in claim 27 includes saidrespective memory controller using the adaptive number of trackingsectors per block, starting with a minimum block size.
 29. The system asrecited in claim 28 includes said respective memory controllerresponsive to the hashes matching between source and target, increasinga next block size by an integral number of tracking sectors.
 30. Thesystem as recited in claim 29 includes said respective memory controllerresponsive to the hashes not matching between source andtarget,decreasing a next block size by an integral number of trackingsectors.
 31. A method for implementing enhanced fast fullsynchronization for remote disk mirroring in a computer systemcomprising: providing a source backup copy locally available to a targetfor remote disk mirroring; providing a tracking space bit map for remotedisk mirroring used for full synchronization; identifying sectors thatare different between the source and target using a hash function over ablock to be compared during the full synchronization with no trackingsectors being sent, setting a tracking space bit in said tracking spacebit map for each tracking sector to be sent to the target; and setting atracking space bit responsive to a corresponding tracking sector beingchanged on the source during the full synchronization.
 32. The method asrecited in claim 31 wherein said hash function includes a selected oneof cryptographic hash algorithm including SHA-1 (Secure HashAlgorithm 1) and SHA-2 (Secure Hash Algorithm 2)
 33. The method asrecited in claim 1 includes initially turning off all the tracking spacebits on the source indicating all tracking sectors are synchronized. 34.The method as recited in claim 33 wherein setting a tracking space bitin said tracking space bit map includes setting the tracking space bitto
 1. 35. The method as recited in claim 33 wherein initially turningoff all the tracking space bits includes setting the tracking space bitsto
 0. 36. The method as recited in claim 31 includes responsive to allhashes having been compared, sending the changed tracking sectors usingsaid tracking space bit map.
 37. The method as recited in claim 31includes using the block being made up of an adaptive number of trackingsectors, starting at a minimum number of tracking sectors.
 38. Themethod as recited in claim 37 includes responsive to the hashes matchingbetween source and target, increasing a next block size by an integralnumber of tracking sectors.
 39. The method as recited in claim 37responsive to the hashes not matching between source and target,decreasing a next block size by an integral number of tracking sectors.